package ds.factcom.controller;

import ds.factcom.controller.client.ClientController;
import ds.factcom.controller.invoice.InvoiceController;
import ds.factcom.controller.payment.PaymentController;
import ds.factcom.controller.product.ProductController;
import ds.factcom.model.MainModel;

/**
 * 
 * @author Javier De Luca, Maximiliano Herrera, Matias Samblancat
 * La clase Main controller representa a un contenedor de controladores.
 * La cual se encarga de administracion de los controladores, creando y otorgando a la vista su
 * correspondiente controlador.
 */
public class MainController {

	private final MainModel mainModel;
	private final ClientController clientController;
	private final ProductController productController;
	private final InvoiceController invoiceController;
	private final PaymentController paymentController;
	
	/**
	 * crear cada controlador con su respectivo modelo.
	 * @param mainModel contenedor de modelos.
	 */
	public MainController(MainModel mainModel) {
		this.mainModel = mainModel;
		this.clientController = new ClientController(this.mainModel.getClientModel());
		this.productController = new ProductController(this.mainModel.getProductModel());
		this.invoiceController = new InvoiceController(this.mainModel.getInvoiceModel());
		this.paymentController = new PaymentController(this.mainModel.getPaymentModel());
	}

	public ClientController getClientController() {
		return clientController;
	}

	public ProductController getProductController() {
		return productController;
	}

	public InvoiceController getInvoiceController() {
		return invoiceController;
	}

	public PaymentController getPaymentController() {
		return paymentController;
	}
}